<template>
  <common-search-wrap @search="search" @reset="reset">
    <el-form ref="formRef" :inline="true" :model="formData">
      <el-form-item label="媒体名称：" prop="mediaName">
        <el-input v-model="formData.mediaName" placeholder="请输入媒体名称" clearable />
      </el-form-item>
      <el-form-item label="媒体账户：" prop="accountName">
        <el-input v-model="formData.accountName" placeholder="请输入媒体账户" clearable />
      </el-form-item>
    </el-form>
  </common-search-wrap>
</template>

<script setup>
import commonSearchWrap from "@/components/commonSearchWrap.vue";
import { reactive } from "vue";
import useForm from '@/hooks/useForm'
const emits = defineEmits(['submit'])
const props = defineProps({
  agencyId: {
    type: [Number, String],
    default: ''
  }
})
/** 搜索的方法 */
const handleSearch = () => {
  emits('submit', { ...formData, agencyId: props.agencyId })
}
const { formRef, search, reset } = useForm(handleSearch)
const formData = reactive({
  accountName: '',
  mediaName: '',
});
</script>